	<h1>Attendance Information</h1>
	<div class="breadcrumbs">
	My Attendance Information | <%=link_to 'Apply Leave',:action => 'apply_leave'%> | <a href="#">Leave Information</a> | <a href="#">Late Information</a></div>
	<div class="extralinks">
	<%1.upto(12) do |month|%> <%a=Date.new(Time.now.year,month)%><%=link_to a.strftime("%B"), :action => 'show_month_attendance',:id => month, :year => Time.now.year%> | <%end%> </div>
<img src="/images/cal_info2.png" />
<table class="tb_listing">
	<thead>
	<tr class="month">
		<td colspan="2"><h3><%a=Date.new(@year,@month)%><%=a.strftime("%B %Y")%></h3></td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
		<td width="3%">&nbsp;</td>
	</tr>
	<tr>
		<th width="5%">Date</th>
		<th width="11%">Clock-in Time</th>
		<th width="11%">Clock-out Time</th>
		<th width="20%">Type of Leave</th>
		<th>Remarks</th>
		<th>&nbsp;</th>
	</tr>
	</thead>
	<%1.upto(@days) do |day|%>
	<tr class="<%= cycle "odd","even" %>">
	<%a = Date.new(@year,@month,day)%>
	<%@leave_detail = LeaveDetail.find(:first,:conditions => ["employee_id = ? and date = ?",session[:employee_id],a])%>
	<%@attendance = Attendance.find(:first,:conditions => ["employee_id = ? and clock_in_date = ?",session[:employee_id],a])%>
		<td width="6%"><%=day%></td>
		<td width="11%"><%=@attendance.clock_in_time.strftime("%I.%M %p") unless @attendance.nil? or @attendance.clock_in_time.nil?%></td>
		<td><%=@attendance.clock_out_time.strftime("%I.%M %p") unless @attendance.nil? or @attendance.clock_out_time.nil?%></td>
		<td><%if @leave_detail.nil?%>-<%else%><%=@leave_detail.leave.leave_type.title%><%end%></td>
		<td><%if @leave_detail.nil?%>-<%else%><%=@leave_detail.leave.remarks%><%end%></td>
		<td>&nbsp;</td>
	</tr>
	<%end%>
</table>

<div class="pagination"> 1 <a href="#">2</a> <a href="#">3</a> <a href="#">4</a>   <a href="#">next &raquo;</a></div> 

